<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 300px;
            /* height: 300px; */
            border: 5px solid red;
            margin: 100px auto;
            overflow: hidden;
            /* 将放大溢出的部分隐藏掉 */

        }
        img{
            width: 100%;
            transition:all 1s;
        }

        div:hover img{
            /* width: 150%; */
            transform: scale(1.5);
            /*1.5是倍数关系  即放大1.5倍*/

            /* 
             支持x轴 y轴单独放大
             scaleX  scaleY
            */
        }
    </style>
</head>
<body>
    <div>
        <img src="../touxiang.png" alt="">
    </div>
</body>
</html>